import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home"
import Source from "../views/Source"
import Production from "../views/Production"
import Me from "../views/Me"

Vue.use(VueRouter);

const routes = [
  {
    path: '/home',
    component: Home
  },
  {
    path: '/home/detail/:id',
    name:'Detail',
    component: () => import('../views/Home/detail')
  },
  //   source  start
  {
    path: '/source',
    component: Source,
    children: [
      {
        path: '/',
        component: () => import('../views/Source/Movie')
      },
      {
        path: '/source/movie',
        component: () => import('../views/Source/Movie')
      },
      {
        path: '/source/software',
        component: () => import('../views/Source/Software')
      },
      {
        path: '/source/website',
        component: () => import('../views/Source/Website')
      }
    ]
  },
  //   source  end
  {
    path: '/production',
    component: Production
  },
  {
    path: '/me',
    component: Me
  },
  {
    path: '/',
    redirect: '/home'
  }
];

const router = new VueRouter({
  routes
});

export default router;
